package cn.yshujia.domain.entity;

import cn.yshujia.handler.PathHandler;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;

/**
 * @author YShuJia
 * @create 2025/3/4
 * @description Album
 */

@Data
@TableName (value = "t_album", autoResultMap = true)
@Schema (name = "Album", description = "相册")
public class Album implements Serializable {
	
	@Serial
	private static final long serialVersionUID = 1L;
	
	@Schema (description = "主键")
	@TableId (value = "id", type = IdType.AUTO)
	private Long id;
	
	@Schema (description = "角色ID")
	@TableField ("role_id")
	private Long roleId;
	
	@Schema (description = "标签ID")
	@TableField ("label_id")
	private Long labelId;
	
	@Schema (description = "标题")
	@TableField ("title")
	private String title;
	
	@Schema (description = "路径，以,隔开")
	@TableField (value = "`path`", typeHandler = PathHandler.class)
	private String path;
	
	@Schema (description = "简介")
	@TableField ("introduction")
	private String introduction;
	
	@Schema (description = "创建时间")
	@TableField (value = "create_time", fill = FieldFill.INSERT)
	@JsonFormat (pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date createTime;
	
	@Schema (description = "是否启用 1 启用 0 停用")
	@TableField ("`status`")
	private Boolean status;
}
